In the history of the medieval Middle East, Khurasan deserves special attention for a number of reasons. After the collapse of the ‘Abbasid Empire by the middle of the tenth century, local regimes and new elites replaced central governmental control throughout the provinces of the old empire. Khurasan was the first settled society that the Turkish Ghaznavid dynasty (established c. 994-98) and the Saljuqs (by 1040) encountered, and it served as a testing ground for the new elite's relations with Muslim communal organizations. Over the centuries, the ulama had developed their own structures of authority and organization (the madhhabs) independent of the state. These religious associations had come to represent Islam in its social and doctrinal aspects. In Khurasan, the religious prestige, judicial authority, and organization of the ulama made them a focus of identity and loyalty and gave them a broad base of popular support.